package com.lovo.sgproj.dao;

import com.lovo.sgproj.bean.RoomBean;
import com.lovo.sgproj.bean.StudentBean;

import java.util.ArrayList;

public interface RoomDAO {
    // select * from t_room
    public ArrayList<RoomBean> findAllRoom();

    // select * from t_room where f_roomtype = ? and f_capNum > f_inNum
    public ArrayList<RoomBean> findAllUserableRoom(boolean roomType);

    // SELECT COUNT(*) FROM t_room WHERE f_roomAddress = ?
    public int getRoomNumByAddress(String roomAddress);

    // INSERT into t_room (f_roomaddress, f_capnum,
    // f_innum,f_roomstatus,f_rentprice,
    // f_roomtype,f_roomhost,f_hosttel,f_roombuildingtype,f_paytype,f_rentdate)
    // VALUES (?,?,?,?,?,?,?,?,?,?,?);
    public void insertRoom(RoomBean room);


    // delete from t_room where pk_roomid = ?
    public void deleteRoomByID(int roomID);

    /* select room.*,stu.f_studentName,stu.f_stuTel,cls.f_classname FROM
     *
     * t_student stu JOIN t_room room
     *
     * ON stu.fk_roomid = room.pk_roomid
     *
     * JOIN t_class cls ON stu.fk_classid=cls.pk_classid
     *
     * where room.pk_roomid = ?
     */
    public RoomBean getRoomAllDetailByID(int roomID);


    // SELECT * from t_room where f_roomAddress like '%?%'
    // and f_roomStatus = ? and f_capNum > f_inNum and f_roomType = ?
    public ArrayList<RoomBean> findAviableRoom(String address, int roomStatus, int availableLive, int roomType);


    // select * from t_room where f_roomtype = ? and f_capNum > f_inNum and
    // pk_roomid <> ?
    public ArrayList<RoomBean> findChangeableRoom(StudentBean stu);
}
